<template>
  <div class="favorite-item-wrapper">
    <span
      :class="{
        selected: select,
      }"
    ></span>
    <p>{{ item.name }}</p>
  </div>
</template>

<script>
export default {
  props: {
    item: Object,
    select: Boolean, // 是否选中
  },
};
</script>

<style lang="less" scoped>
@import "~@/styles/myStyle.less";
.favorite-item-wrapper {
  padding: 15px 0;
  font-size: 14px;
  color: #222;
  cursor: pointer;
  &:hover {
    span {
      background-image: url();
    }
    p {
      color: @blue;
    }
  }
  span {
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-right: 18px;
    vertical-align: middle;
    background-image: url();
    &.selected {
      background-image: url();
    }
  }
  p {
    display: inline-block;
    max-width: 220px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 16px;
    transition: color 0.2s ease-in;
  }
}
</style>